def check_input(fp):
    import GlobalParam

    gp=GlobalParam.iparam

    fp.write(" - Input paramters\n")
    str1="  Lattice structure: %s\n"
    str2="  Lattice parameter: %f\n"
    str3="  Layer to be ignored: %d\n"
    str4="  Source file form: %s\n"
    str5="  xmakemol file form: %s\n"
    str6="  kmc file form: %s\n"
    fp.write(str1 % gp.get_struct())
    fp.write(str2 % gp.get_lattice_param())
    fp.write(str3 % gp.get_ignore_layer())
    fp.write(str4 % gp.get_source_file())
    fp.write(str5 % gp.get_xmakemol())
    fp.write(str6 % gp.get_kmcname())
    fp.write("\n")

    # Check srcfile and xmlfile
    fp.write(" - Source file list\n")
    for i in range(gp.get_nsrcfile()):
        fp.write("  Source file[%d]=%s\n" % (i+1,gp.get_srcfile(i)))
    fp.write("\n")

    fp.write(" - xmakemol file list\n")
    for i in range(gp.get_nxmlfile()):
        fp.write("  Source file[%d]=%s\n" % (i+1,gp.get_xmlfile(i)))
    fp.write("\n")

    fp.write(" - kmc file list\n")
    for i in range(gp.get_nkmcfile()):
        fp.write("  Source file[%d]=%s\n" % (i+1,gp.get_kmcfile(i)))
    fp.write("\n")

def check_cell_param(fp):
    import GlobalParam

    gp=GlobalParam.iparam

    fp.write(" - Basic parameters\n")
    fp.write("  Number of total atoms=%d\n" % gp.get_natom())
    fp.write("  Number of total cells=%d\n" % gp.get_ncell())
    fp.write("  Number of cells in one plane=%d\n" % gp.get_ncell_in_plane())
    fp.write("  Number of cells in one side=%d\n" % gp.get_ncell_in_line())
    fp.write("  Box width in Angstrom=%.3f\n" % gp.get_boxwidth())
    fp.write("\n")

def check_basis(fp):
    import GlobalParam

    gp=GlobalParam.iparam

    fp.write(" - Basis parameters\n")
    fp.write("  Number of basis=%d\n" % gp.get_nbasis())
    for i in range(gp.get_nbasis()):
        fp.write("  Basis[%d]= Norm(%.3f,%.3f,%.3f), Angs(%.3f,%.3f,%.3f)\n" % (i,\
                     gp.get_basis_pos(i)[0],gp.get_basis_pos(i)[1],gp.get_basis_pos(i)[2],\
                     gp.get_basis2_pos(i)[0],gp.get_basis2_pos(i)[1],gp.get_basis2_pos(i)[2]))
    fp.write("\n")             
        
